
<div>
	<ul>
		<li>
			<h2>Why is the SimpleObject</h2>
			<p>Why we prefer SimpleObject to noraml Java Object in GWT client
				side? Even SimpleObject is not type-safe. GWT is compiled to js and
				it does't support Java reflection directly(deffered binding do this,
				but it is not simple enough). Sometimes, Using reflection saves our
				code clear. More readable, maintainable and fast development that is
				what we want, right?</p>
		</li>
		<li>
			<h2>The Benifit</h2>
			<p>
				We just get and set properties by name via SimpleObject. If you have
				been a Javascript programer, you would love this more.<br/> For
				widgets that may present properties of an object, like
				<code>DataGrid</code>
			</p> <pre>
DataGrid&lt;User&gt; dataGrid = new DataGrid&lt;User&gt;();
Column&lt;User, String&gt; firstNameColumn = new Column&lt;User, String&gt;(
    new TextCell()) {
  @Override
  public String getValue(ContactInfo object) {
    return object.getFirstName();
  }
};
Column&lt;User, String&gt; lastNameColumn = new Column&lt;User, String&gt;(
    new TextCell()) {
  @Override
  public String getValue(ContactInfo object) {
    return object.getLastName();
  }
};
dataGrid.addColumn(firstNameColumn,"FirstName");
dataGrid.addColumn(lastNameColumn,"LastName");
   ...
</pre> If we use SimpleObject as type object, the code would be, <pre>
DataGrid&lt;SimpleObject&gt; dataGrid = new DataGrid&lt;SimpleObject&gt;();
dataGrid.addColumn(new TextColumn("firstName"),"FirstName");
dataGrid.addColumn(new TextColumn("lastName"),"LastName");
...
</pre>
			<ul>
				<li>See <a href="#/DataGridDemo">The DataGrid Demo</a>
				</li>
				<li>And <a href="#/CellTreeDemo">The CellTree Demo</a>
				</li>
			</ul>
		</li>
		<li>
			<h2>The Trade Off</h2>
			<p>As mention above, SimpleObject is not type-safe. It is allowed
				to put any object value to it. We can not guarantee the same key
				always maps to an object of same type. For this, The Entity, POJO,
				VO and FormBean is still necessary. But it is just used in the server side. Although the SimpleObject
				maybe a little unsafe, but we can use those explicit object to testing keys and values of it.</p>
		</li>
		<li>
			<h2>The Client&Server Communication</h2>
			<p>
			For above, SimpleObject is used in client side, POJO is used in server side.
			With JSON serialization and deserialization. Everything is the same, a json string.
			</p>
			For the SpringMVC integration to save a user's information,
<pre>
// ...
// the client view
SimpleObjectt user = view.getFormData(null);
// just send a http request
// serializaztion & deserialization for SimpleObject is very easy, we don't need to worry about it! 
Requests.postObject("user/save.do", user, new StatedCallback() {

  @Override
  protected void onSuccess(String result) {
    Alert.alert("Save Succeed");
  }
});
</pre>
			
<pre>
// ...
// the service provider
@RequestMapping("user")
public class UserBO {
	@RequestMapping("save")
	@ResponseBody
	public void save(@RequestBody User entity) {
	  userDao.save(entity);
	}
	// ...
}
</pre>
			<ul>
				<li>See <a href="#/UserManage">The User Manage</a>
				</li>
			</ul>
		</li>
	</ul>

</div>
